<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jQuery的类数组对象结构</title>
    <script src="../lib/jquery.js"></script>
</head>
<body>
<button id="test3">aQuery[0]</button>
<div style="display: none">
    <button id="block">1133</button>
</div>

<script>
    // 模拟一个选择结构
    var aQuery = function (selector) {
        if(!(this instanceof aQuery)){
            return new aQuery(selector);
        }
        var ele = document.getElementById(/[^#].*/.exec(selector)[0]);
        this.length = 1;
        this[0] = ele;
        this.context = document;
        this.selector = selector;
        this.get = function (num) {
            return this[num];
        }
        return this;
    }

    $("#test3").click(function() {
        $('body').append(aQuery("#block")[0]);
    });




</script>
</body>
</html>